package com.lsfb.signln.Location.LocationSearch.ReplenishSignIn;

import android.content.Context;
import android.view.View;

import com.lsfb.signln.R;
import com.zgscwjm.lsfbbasetemplate.adapter.CommonRecycAdapter;
import com.zgscwjm.lsfbbasetemplate.adapter.ViewHolderRecyc;

import java.util.List;

/**
 * Created by Administrator on 2018/2/7 0007.
 */

public class SearchAddressAdapter extends CommonRecycAdapter<SearchCityBean.ListBean> {
    private Context mContext;
    private ItemClickListener listener;

    public interface ItemClickListener {
        void onClick(SearchCityBean.ListBean model);
    }

    public SearchAddressAdapter(Context context, List<SearchCityBean.ListBean> list, int layoutId, ItemClickListener listener) {
        super(context, list, layoutId);
        mContext = context;
        this.listener = listener;
    }

    @Override
    public void convert(ViewHolderRecyc holder, final SearchCityBean.ListBean model) {
        holder.setText(R.id.tv_reason, model.getCityName());

        holder.setOnclick(R.id.item_address, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (listener != null) {
                    listener.onClick(model);
                }
            }
        });
    }
}
